package cn.dnui_xqh414.dnuifood_16110100414.model;

import cn.dnui_xqh414.dnuifood_16110100414.iface.FoodlistIface;
import cn.dnui_xqh414.dnuifood_16110100414.listener.OnRetrofitListener;
import cn.dnui_xqh414.dnuifood_16110100414.service.ShopService;
import retrofit2.Call;

public class FoodlistModel extends BaseModel implements FoodlistIface {
    private ShopService shopService;

    public FoodlistModel() {

        super();
        shopService = retrofit.create(ShopService.class);
    }

    @Override
    public void getFoodlist(String shop_id, OnRetrofitListener listener){

        Call call = shopService.getFoodlist(shop_id);
        bindCallBack(call,listener,1);

    }

    @Override
    public void getAllcomments(int food_id, OnRetrofitListener listener) {
        Call call = shopService.getComments(food_id);
        bindCallBack(call,listener,2);
    }

    @Override
    public void getFoodbyId(int food_id, OnRetrofitListener listener) {
        Call call = shopService.getFoodById(food_id);
        bindCallBack(call,listener,3);
    }
}
